import { RESPONSE_MAP } from './service/response.ts';
import type { ResponseCode } from './types';

export class EasyKoaException extends Error {
  constructor(
    public code: ResponseCode,
    message?: string,
  ) {
    super(message || RESPONSE_MAP[code]);
    this.code = code;
  }
}
